package com.ruoyi.basicData.ruleSetting.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basicData.ruleSetting.mapper.AccessorySupplierRelevanceMapper;
import com.ruoyi.basicData.ruleSetting.domain.AccessorySupplierRelevance;
import com.ruoyi.basicData.ruleSetting.service.IAccessorySupplierRelevanceService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 配件ID和供应商关联Service业务层处理
 * 
 * @author YiYuan
 * @date 2024-01-23
 */
@Service
public class AccessorySupplierRelevanceServiceImpl implements IAccessorySupplierRelevanceService 
{
    @Autowired
    private AccessorySupplierRelevanceMapper accessorySupplierRelevanceMapper;

    /**
     * 查询配件ID和供应商关联
     * 
     * @param id 配件ID和供应商关联主键
     * @return 配件ID和供应商关联
     */
    @Override
    public AccessorySupplierRelevance selectAccessorySupplierRelevanceById(Long id)
    {
        return accessorySupplierRelevanceMapper.selectAccessorySupplierRelevanceById(id);
    }

    /**
     * 查询配件ID和供应商关联列表
     * 
     * @param accessorySupplierRelevance 配件ID和供应商关联
     * @return 配件ID和供应商关联
     */
    @Override
    public List<AccessorySupplierRelevance> selectAccessorySupplierRelevanceList(AccessorySupplierRelevance accessorySupplierRelevance)
    {
        return accessorySupplierRelevanceMapper.selectAccessorySupplierRelevanceList(accessorySupplierRelevance);
    }

    /**
     * 新增配件ID和供应商关联
     * 
     * @param accessorySupplierRelevance 配件ID和供应商关联
     * @return 结果
     */
    @Override
    public int insertAccessorySupplierRelevance(AccessorySupplierRelevance accessorySupplierRelevance)
    {
        return accessorySupplierRelevanceMapper.insertAccessorySupplierRelevance(accessorySupplierRelevance);
    }

    /**
     * 修改配件ID和供应商关联
     * 
     * @param accessorySupplierRelevance 配件ID和供应商关联
     * @return 结果
     */
    @Override
    public int updateAccessorySupplierRelevance(AccessorySupplierRelevance accessorySupplierRelevance)
    {
        return accessorySupplierRelevanceMapper.updateAccessorySupplierRelevance(accessorySupplierRelevance);
    }

    /**
     * 批量删除配件ID和供应商关联
     * 
     * @param ids 需要删除的配件ID和供应商关联主键
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteAccessorySupplierRelevanceByIds(Long[] ids)
    {
        return accessorySupplierRelevanceMapper.deleteAccessorySupplierRelevanceByIds(ids);
    }

    /**
     * 删除配件ID和供应商关联信息
     * 
     * @param id 配件ID和供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteAccessorySupplierRelevanceById(Long id)
    {
        return accessorySupplierRelevanceMapper.deleteAccessorySupplierRelevanceById(id);
    }

    @Override
    public boolean hasSupplier(String accessoryType, String str) {
        return accessorySupplierRelevanceMapper.hasSupplier(accessoryType, str);
    }
}
